
public class Child extends Parent {
    @Override
    public synchronized void syncMethod() {
        System.out.println("Child start"+Thread.currentThread().getId());
        super.syncMethod();
        System.out.println("Child end"+Thread.currentThread().getId());
    }
    public static void main(String[] args) {
        Child child1 = new Child();
        Thread thread1 = new Thread(()->{child1.syncMethod();});
        Thread thread2 = new Thread(()->{child1.syncMethod();});
        thread1.start();
        thread2.start();
    }
}



